<template>
    <div>
        <el-menu default-active="1-4-1" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose" :collapse="isCollapse">
            <el-menu-item index="1">
                <i class="fa fa-tachometer"></i>
                <router-link to="/admin/main" slot="title">首页</router-link>
            </el-menu-item>
            <el-submenu index="2">
                <template slot="title">
                    <i class="fa fa-users"></i>
                    <span>用户中心</span>
                </template>
                    <el-menu-item index="2-1">
                        <router-link to="/admin/users" slot="title">用户列表</router-link>
                    </el-menu-item>
            </el-submenu>
            <el-submenu index="3">
                <template slot="title">
                    <i class="fa fa-unlock"></i>
                    <span>权限管理</span>
                </template>
                <el-menu-item index="3-1">
                    <router-link to="/admin/admins" slot="title">管理员列表</router-link>
                </el-menu-item>
                <el-menu-item index="3-2">
                    <router-link to="/admin/roles" slot="title">角色列表</router-link>
                </el-menu-item>
                <el-menu-item index="3-3">
                    <router-link to="/admin/permissions" slot="title">权限列表</router-link>
                </el-menu-item>
            </el-submenu>
            <el-submenu index="4">
                <template slot="title">
                    <i class="fa fa-unlock"></i>
                    <span>菜单管理</span>
                </template>
                <el-menu-item index="4-1">
                    <router-link to="/admin/menus" slot="title">后台菜单</router-link>
                </el-menu-item>
            </el-submenu>
        </el-menu>
    </div>
</template>
<script>
    export default {
        data() {
            return {
                isCollapse: false
            };
        },
        methods: {
            handleOpen(key, keyPath) {
                console.log(key, keyPath);
            },
            handleClose(key, keyPath) {
                console.log(key, keyPath);
            }
        },
        mounted(){
            console.log(this.$router);
        }
    }
</script>



